#! /bin/sh /usr/share/dpatch/dpatch-run
## 06_unit_dbase.dpatch by  <Mazen Neifer <mazen.neifer@supaero.org>>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: This patch fixes dist_clean target used to remove generated
## DP: files before packaging sources.

@DPATCH@
Index: components/Makefile.fpc
===================================================================
--- lazarus~/components/Makefile.fpc	(revision 13662)
+++ lazarus/components/Makefile.fpc	(working copy)
@@ -18,12 +18,14 @@
       $(wildcard ./custom/*$(RSTEXT))
 
 [rules]
-.phony: bigidecomponents
+.PHONY: bigidecomponents bigideclean
 
 bigidecomponents: all
         $(MAKE) -C rtticontrols
+ifeq (${CPU_TARGET}, i386)
         $(MAKE) -C printers
         $(MAKE) -C printers/design
+endif
         $(MAKE) -C cgi
         $(MAKE) -C cgi/ide
         $(MAKE) -C turbopower_ipro
@@ -40,3 +42,23 @@
 endif
 
 cleanlaz: clean
+
+cleanall: clean bigideclean
+
+bigideclean:
+        $(MAKE) -C rtticontrols cleanall
+        $(MAKE) -C printers cleanall
+        $(MAKE) -C printers/design cleanall
+        $(MAKE) -C cgi cleanall
+        $(MAKE) -C cgi/ide cleanall
+        $(MAKE) -C turbopower_ipro cleanall
+        $(MAKE) -C fpcunit cleanall
+        $(MAKE) -C fpcunit/ide cleanall
+        $(MAKE) -C projecttemplates cleanall
+        $(MAKE) -C memds cleanall
+        $(MAKE) -C sdf cleanall
+        $(MAKE) -C tachart cleanall
+ifneq ($(OS_TARGET),darwin)
+        $(MAKE) -C tdbf cleanall
+        $(MAKE) -C sqldb cleanall
+endif
Index: components/tachart/Makefile.fpc
===================================================================
--- lazarus~/components/tachart/Makefile.fpc	(revision 13662)
+++ lazarus/components/tachart/Makefile.fpc	(working copy)
@@ -41,3 +41,5 @@
         -$(DEL) $(COMPILER_UNITTARGETDIR)/tachartlazaruspkg$(PPUEXT)
 
 all: cleartarget $(COMPILER_UNITTARGETDIR) tachartlazaruspkg$(PPUEXT)
+
+cleanall: clean
Index: components/cgi/ide/Makefile.fpc
===================================================================
--- lazarus~/components/cgi/ide/Makefile.fpc	(revision 13662)
+++ lazarus/components/cgi/ide/Makefile.fpc	(working copy)
@@ -41,3 +41,5 @@
         -$(DEL) $(COMPILER_UNITTARGETDIR)/cgilazide$(PPUEXT)
 
 all: cleartarget $(COMPILER_UNITTARGETDIR) cgilazide$(PPUEXT)
+
+cleanall: clean
Index: components/cgi/Makefile.fpc
===================================================================
--- lazarus~/components/cgi/Makefile.fpc	(revision 13662)
+++ lazarus/components/cgi/Makefile.fpc	(working copy)
@@ -41,3 +41,5 @@
         -$(DEL) $(COMPILER_UNITTARGETDIR)/cgilaz$(PPUEXT)
 
 all: cleartarget $(COMPILER_UNITTARGETDIR) cgilaz$(PPUEXT)
+
+cleanall: clean
Index: components/rtticontrols/Makefile.fpc
===================================================================
--- lazarus~/components/rtticontrols/Makefile.fpc	(revision 13662)
+++ lazarus/components/rtticontrols/Makefile.fpc	(working copy)
@@ -41,3 +41,5 @@
         -$(DEL) $(COMPILER_UNITTARGETDIR)/runtimetypeinfocontrols$(PPUEXT)
 
 all: cleartarget $(COMPILER_UNITTARGETDIR) runtimetypeinfocontrols$(PPUEXT)
+
+cleanall: clean
Index: components/printers/Makefile.fpc
===================================================================
--- lazarus~/components/printers/Makefile.fpc	(revision 13662)
+++ lazarus/components/printers/Makefile.fpc	(working copy)
@@ -41,3 +41,5 @@
         -$(DEL) $(COMPILER_UNITTARGETDIR)/printer4lazarus$(PPUEXT)
 
 all: cleartarget $(COMPILER_UNITTARGETDIR) printer4lazarus$(PPUEXT)
+
+cleanall: clean
Index: components/printers/design/Makefile.fpc
===================================================================
--- lazarus~/components/printers/design/Makefile.fpc	(revision 13662)
+++ lazarus/components/printers/design/Makefile.fpc	(working copy)
@@ -40,3 +40,5 @@
         -$(DEL) $(COMPILER_UNITTARGETDIR)/printers4lazide$(PPUEXT)
 
 all: cleartarget $(COMPILER_UNITTARGETDIR) printers4lazide$(PPUEXT)
+
+cleanall: clean
Index: components/tdbf/Makefile.fpc
===================================================================
--- lazarus~/components/tdbf/Makefile.fpc	(revision 13662)
+++ lazarus/components/tdbf/Makefile.fpc	(working copy)
@@ -41,3 +41,5 @@
         -$(DEL) $(COMPILER_UNITTARGETDIR)/dbflaz$(PPUEXT)
 
 all: cleartarget $(COMPILER_UNITTARGETDIR) dbflaz$(PPUEXT)
+
+cleanall: clean
Index: components/projecttemplates/Makefile.fpc
===================================================================
--- lazarus~/components/projecttemplates/Makefile.fpc	(revision 13662)
+++ lazarus/components/projecttemplates/Makefile.fpc	(working copy)
@@ -41,3 +41,5 @@
         -$(DEL) $(COMPILER_UNITTARGETDIR)/projtemplates$(PPUEXT)
 
 all: cleartarget $(COMPILER_UNITTARGETDIR) projtemplates$(PPUEXT)
+
+cleanall: clean
Index: components/memds/Makefile.fpc
===================================================================
--- lazarus~/components/memds/Makefile.fpc	(revision 13662)
+++ lazarus/components/memds/Makefile.fpc	(working copy)
@@ -41,3 +41,5 @@
         -$(DEL) $(COMPILER_UNITTARGETDIR)/memdslaz$(PPUEXT)
 
 all: cleartarget $(COMPILER_UNITTARGETDIR) memdslaz$(PPUEXT)
+
+cleanall: clean
Index: components/sqldb/Makefile.fpc
===================================================================
--- lazarus~/components/sqldb/Makefile.fpc	(revision 13662)
+++ lazarus/components/sqldb/Makefile.fpc	(working copy)
@@ -41,3 +41,5 @@
         -$(DEL) $(COMPILER_UNITTARGETDIR)/sqldblaz$(PPUEXT)
 
 all: cleartarget $(COMPILER_UNITTARGETDIR) sqldblaz$(PPUEXT)
+
+cleanall: clean
Index: components/fpcunit/ide/Makefile.fpc
===================================================================
--- lazarus~/components/fpcunit/ide/Makefile.fpc	(revision 13662)
+++ lazarus/components/fpcunit/ide/Makefile.fpc	(working copy)
@@ -41,3 +41,5 @@
         -$(DEL) $(COMPILER_UNITTARGETDIR)/fpcunitide$(PPUEXT)
 
 all: cleartarget $(COMPILER_UNITTARGETDIR) fpcunitide$(PPUEXT)
+
+cleanall: clean
Index: components/fpcunit/Makefile.fpc
===================================================================
--- lazarus~/components/fpcunit/Makefile.fpc	(revision 13662)
+++ lazarus/components/fpcunit/Makefile.fpc	(working copy)
@@ -41,3 +41,5 @@
         -$(DEL) $(COMPILER_UNITTARGETDIR)/fpcunittestrunner$(PPUEXT)
 
 all: cleartarget $(COMPILER_UNITTARGETDIR) fpcunittestrunner$(PPUEXT)
+
+cleanall: clean
Index: components/sdf/Makefile.fpc
===================================================================
--- lazarus~/components/sdf/Makefile.fpc	(revision 13662)
+++ lazarus/components/sdf/Makefile.fpc	(working copy)
@@ -41,3 +41,5 @@
         -$(DEL) $(COMPILER_UNITTARGETDIR)/sdflaz$(PPUEXT)
 
 all: cleartarget $(COMPILER_UNITTARGETDIR) sdflaz$(PPUEXT)
+
+cleanall: clean
Index: tools/apiwizz/Makefile.fpc
===================================================================
--- lazarus~/tools/apiwizz/Makefile.fpc	(revision 13662)
+++ lazarus/tools/apiwizz/Makefile.fpc	(working copy)
@@ -13,7 +13,7 @@
 packages=rtl
 
 [clean]
-#units=apiwizard
+units=apiwizard
 
 [compiler]
 options=-gl $(LAZARUS_LIBPATHS)
Index: lcl/interfaces/gtk2/Makefile.fpc
===================================================================
--- lazarus~/lcl/interfaces/gtk2/Makefile.fpc	(revision 13662)
+++ lazarus/lcl/interfaces/gtk2/Makefile.fpc	(working copy)
@@ -14,10 +14,9 @@
 implicitunits=gtk2int
 
 [compiler]
-options=-gl -dgtk2
+options=-gl -dgtk2 -Fi../gtk
 unitdir=../../units/$(CPU_TARGET)-$(OS_TARGET) ../gtk .
 unittargetdir=../../units/$(CPU_TARGET)-$(OS_TARGET)/gtk2
-includedir=../gtk
 
 [clean]
 files=$(wildcard $(COMPILER_UNITTARGETDIR)/*$(OEXT)) \
Index: examples/Makefile.fpc
===================================================================
--- lazarus~/examples/Makefile.fpc	(revision 13662)
+++ lazarus/examples/Makefile.fpc	(working copy)
@@ -37,6 +37,9 @@
 
 [clean]
 files=$(wildcard *$(OEXT)) $(wildcard *$(PPUEXT)) \
+  $(wildcard units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) \
+  $(wildcard units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) \
+  $(wildcard trayicon/*$(OEXT)) $(wildcard trayicon/*$(PPUEXT)) \
   hello \
   bitbutton \
   checkbox \
@@ -88,3 +91,4 @@
 LAZARUS_OPT+= -WG
 endif
 
+cleanall: clean
